package com.hwangjr.rxbus.entity;

import com.hwangjr.rxbus.Bus;

/**
 * Wraps an event that was posted, but which had no subscribers and thus could not be delivered. Subscribing
 * DeadEvent is useful for debugging or logging, as it can detect misconfigurations in system's event distribution
 */
public class DeadEvent {
    /**
     * source
     */
    private final Object source;
    /**
     * event
     */
    private final Object event;

    /**
     * Creates new DeadEvent.
     *
     * @param source object broadcasting the DeadEvent (generally the {@link Bus}).
     * @param event  the event that could not be delivered
     */
    public DeadEvent(Object source, Object event) {
        this.source = source;
        this.event = event;
    }

    /**
     * getSource
     *
     * @return Object object
     */
    public Object getSource() {
        return source;
    }

    /**
     * getEvent
     *
     * @return Object object
     */
    public Object getEvent() {
        return event;
    }
}
